#!/usr/bin/env bash
svnLibraryPath=$1
projectSubPath=$2
pictureSubPath=$3
originPlatformName=$4
workPlatformName=$5

#修改工程文件夹名称相关代码
originPlatformPath=${svnLibraryPath}${projectSubPath}"/proj.ios_appstore_"${originPlatformName}
workPlatformPath=${svnLibraryPath}${projectSubPath}"/proj.ios_appstore_"${workPlatformName}
if [ ! -d "$originPlatformPath" ]; then
	echo ${originPlatformName}"工程不存在"
	echo $originPlatformPath
else
	if [ ! -d "$workPlatformPath" ]; then
		cp -r "$originPlatformPath" "$workPlatformPath"
		echo "生成工程文件夹""proj.ios_appstore_"${workPlatformName}
	else
		echo ${workPlatformName}"工程已经存在"
		echo $workPlatformPath
	fi
fi

#修改图片资源文件夹名称相关代码
originPlatformPicturePath=${svnLibraryPath}${pictureSubPath}"/"${originPlatformName}
workPlatformPicturePath=${svnLibraryPath}${pictureSubPath}"/"${workPlatformName}
if [ ! -d "$originPlatformPicturePath" ]; then
	echo ${originPlatformName}"图片资源文件夹不存在"
	echo $originPlatformPicturePath 
else
	if [ ! -d "$workPlatformPicturePath" ]; then
		cp -r "$originPlatformPicturePath" "$workPlatformPicturePath"
		echo "生成图片资源文件夹"${workPlatformName}
	else
		echo ${workPlatformName}"图片资源文件夹已经存在" 
		echo $workPlatformPicturePath
	fi
fi